import java.math.*;

public class DhClient {
	private int y, g, n;
	private BigInteger  A, B, S;	

	
	
	public DhClient() {
		y = (int)(Math.random()*500);
		y += 25;
		if (y<0)
			y*=-1;
	}


	public int getY() {
		return y;
	}
	public void setY(int y) {
		this.y = y;
	}
	public int getG() {
		return g;
	}
	public void setG(int g) {
		this.g = g;
	}
	public int getN() {
		return n;
	}
	public void setN(int n) {
		this.n = n;
	}
	public BigInteger getA() {
		return A;
	}
	public void setA(BigInteger a) {
		A = a;

		B = new BigInteger(new Integer(g).toString());
		B = B.pow(y);
		B = B.mod(new BigInteger(new Integer(n).toString()));
		
		S = A;
		S = S.pow(y);
		S = S.mod(new BigInteger(new Integer(n).toString()));
	}
	public BigInteger getB() {
		return B;
	}
	public void setB(BigInteger b) {
		B = b;
	}
	public BigInteger getS() {
		return S;
	}
	public void setS(BigInteger s) {
		S = s;
	}


	@Override
	public String toString() {
		return "DhClient [y=" + y + ", g=" + g + ", n=" + n + ", A=" + A
				+ ", B=" + B + ", S=" + S + "]";
	}
	

}
